﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls.WebParts;
using System.Text;
using RED_NET_Core.BLL;
using RED_NET_Core.Entity;

namespace RED_NET.ContentPage
{
    public partial class Login : System.Web.UI.Page
    {
        public String[] Picture, OfNewsUrl,NewsName;
        protected void Page_Load(object sender, EventArgs e)
        {
            GridView2.Visible = Button2.Visible = false;
            GridView1.Visible = Button1.Visible = true;
            Manager_BLL manager = new Manager_BLL();
            int Uid = 1;
            Picture = manager.GetTrendOfManager(Uid);
            OfNewsUrl = manager.GetNewsIdOfTrendImage(Uid);
            for (int i = 0; i < 4; i++)
            {
                OfNewsUrl[i] = "News/ShowDaily.aspx?VISIT_ID=1&_Id=" + OfNewsUrl[i];
            }
            NewsName = manager.GetNewsNameOfTrendImage(Uid);
            for (int i = 0; i < 4; i++)
            {
                if (NewsName[i] == null)
                    NewsName[i] = "未命名";
            }
            //Response.Write("<script>alert('" + OfNewsUrl[0] + "','" + NewsName[0] + "');</script>");
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            GridView2.Visible = Button2.Visible = true;
            GridView1.Visible = Button1.Visible = false;
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            GridView2.Visible = Button2.Visible = false;
            GridView1.Visible = Button1.Visible = true;
        }
    }
}